<template>
  <slot name="button"
    ><el-button type="primary" @click="controls" @keydown.enter="handleEnter">{{
      msg
    }}</el-button></slot
  >
</template>

<script setup lang="ts">
import { defineProps, defineEmits } from 'vue'
defineProps<{
  msg: string
}>()

const emits = defineEmits(['control', 'keydown'])

const controls = () => {
  emits('control')
}

const handleEnter = () => {
  emits('keydown')
}
</script>
